package com.seeTools.boot.pc.provider;

import com.seeTools.boot.api.service.pc.PcDicDataService;
import com.seeTools.boot.pc.service.sys.SysDictDataService;
import org.apache.dubbo.config.annotation.DubboService;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @Author: seeTools
 * @Date: 2024/6/7  10:37
 * @Version 1.0
 */
@DubboService(version = "1.0", timeout = 3000)
public class PcDicDataServiceImpl implements PcDicDataService {

    @Resource
    private SysDictDataService sysDictDataService;


    /**
     * 根据字典类型和字典值获取字典标签
     *
     * @param dictType
     * @param dictValue
     * @return
     */
    @Override
    public String getDictLabel(String dictType, String dictValue) {
        return sysDictDataService.getDictLabel(dictType, dictValue);
    }


    /**
     * 根据字典类型和字典值获取字典标签
     *
     * @param dictType
     * @param dictValues
     * @return
     */
    public String getDictLabels(String dictType, String dictValues) {
        return sysDictDataService.getDictLabels(dictType, dictValues);
    }


    /**
     * 根据字典类型和字典标签获取字典值
     *
     * @param dictType  字典类型
     * @param dictLabel 字典标签
     * @return 字典值
     */
    @Override
    public String getDictValue(String dictType, String dictLabel) {
        return sysDictDataService.getDictValue(dictType, dictLabel);
    }


    /**
     * 根据字典类型和字典标签获取字典值
     *
     * @param dictType   字典类型
     * @param dictLabels 字典标签
     * @return 字典值
     */
    @Override
    public String getDictValues(String dictType, String dictLabels) {
        return sysDictDataService.getDictValues(dictType, dictLabels);
    }

    /**
     * 获取字典下所有的字典值与标签
     *
     * @param dictType 字典类型
     * @return dictValue为key，dictLabel为值组成的Map
     */
    @Override
    public Map<String, String> getAllDictByDictType(String dictType) {
        return sysDictDataService.getAllDictByDictType(dictType);
    }
}
